http://www.wavecom.com/forum

Release version:
3.04

Sample - Application Download

Changes

Dependencies

This sample depends on the following libraries :

Application Description

This application allows to perform download and upload operations, through a serial link, the GSM data link, or to/from a FTP server. The downloaded data can be stored in a RAM buffer, or in an A&D cell.

The download and upload operations are processed by the Download library.

The IP and FTP connection are processed by the IPConnect library. Please note that TCPIP connection parameters have firstly to be set using IPConnect commands set, before using this sample features.

As this application uses the MultiApp library, the following start/stop command has to be used to control the application execution.

 

  AT+DWLSTART (Application Download start/stop command)
CommandAnswers
AT+DWLSTART?+DWLSTART: <state>
OK
AT+DWLSTART=?+DWLSTART: (0-1)
OK
AT+DWLSTART= <state> +CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
state0-1The current application running state. This parameter is stored in non-volatile memory.0

The init entry point sent to the MultiApp library is the appdwl_init() function. The start/stop entry points linked to the +DWLSTART command are the appdwl_Start() and appdwl_Stop() functions.

 

     Download and upload through a serial link or from/to a FTP server

The following command set allows an external application to manage RAM and application download and upload via the serial link or with a remote FTP server.

 

  AT+USEIP (IP Library startup command)
CommandAnswers
AT+USEIP?+USEIP: <option>
OK
AT+USEIP=?+USEIP: (0-1)
OK
AT+USEIP= <option> +CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
option0-1Use IP library or not ; on value change, the product has to be reset. This parameter is stored in non-volatile memory.0

 

  AT+RAMDWL (RAM download command)
CommandAnswers
AT+RAMDWL?+RAMDWL: <size>
OK
AT+RAMDWL=?+RAMDWL: (1-20) , (0-1) , (120) , (120)
OK
AT+RAMDWL= <size> ,[ <protocol> ],[ <filename> ],[ <filepath> ]+CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
size1-20RAM buffer size (in KBytes) where to copy downloaded data. This RAM buffer is allocated, and the dwl_Download API is used to start the download.mandatory
protocol0-10 : 1K XModem protocol on serial link
1 : FTP protocol
0
filename120If FTP protocol is used, name of the file to download from the server.NA
filepath120If FTP protocol is used, path of the file to download from the server ("." for server root directory).NA

 

  AT+RAMUPL (RAM upload command)
CommandAnswers
AT+RAMUPL?+RAMUPL: <size>
OK
AT+RAMUPL=?+RAMUPL: (0-1) , (120) , (120)
OK
AT+RAMUPL= <protocol> ,[ <filename> ],[ <filepath> ]+CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
protocol0-10 : 1K XModem protocol on serial link
1 : FTP protocol
If something was previously downloaded in the RAM buffer, this command uses the dwl_Upload API to start the upload.
NA
filename120If FTP protocol is used, name of the file to upload on the server.NA
filepath120If FTP protocol is used, path of the file to upload on the server ("." for server root directory).NA
size1-20Current RAM buffer size (can only be read)NA

 

  AT+APPDWL (Application download command)
CommandAnswers
AT+APPDWL?+APPDWL: <ID> , <size>
OK
AT+APPDWL=?+APPDWL: (0-3) , (u32) , (0-1) , (120) , (120)
OK
AT+APPDWL= <mode> , <ID> ,[ <protocol> ],[ <filename> ],[ <filepath> ]+CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
mode0-30 : uses the dwl_Download API to start application download. The application is not installed on download end.
1 : uses the dwl_Download API to start application download. The application is installed on download end.
2 : installs an application previously downloaded with the AT+APPDWL=0 command.
3 : deletes the required cell ID.
mandatory
IDu32ID of the storage cell.NA
protocol0-10 : 1K XModem protocol on serial link
1 : FTP protocol
0
filename120If FTP protocol is used, name of the file to download from the server.NA
filepath120If FTP protocol is used, path of the file to download from the server ("." for server root directory).NA
sizeu32Size of the storage cell (can only be read)NA

 

  AT+APPUPL (Application upload command)
CommandAnswers
AT+APPUPL?+APPUPL: <ID> , <size>
OK
AT+APPUPL=?+APPUPL: (0-1) , (u32) , (120) , (120)
OK
AT+APPUPL=[ <protocol> ], <ID> ,[ <filename> ],[ <filepath> ]+CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
protocol0-10 : 1K XModem protocol on serial link
1 : FTP protocol
0
IDu32ID of the storage cell.NA
filename120If FTP protocol is used, name of the file to upload on the server.NA
filepath120If FTP protocol is used, path of the file to upload on the server ("." for server root directory).NA
sizeu32Size of the storage cell (can only be read)NA

 

 

     Application Over The Air Download, using XModem protocol on GSM bearer

When the application receives a GSM data call indication, it answers it automaticaly. On the CONNECT indication, the dwl_Download API is used to start the application download via the GSM data link, in authentification mode. The remote part is prompted to give a password in order to start the download. This password is "startdota" by default, and can be change by the AT+DWLPWD command :

 

  AT+DWLPWD (Change password command)
CommandAnswers
AT+DWLPWD=?+DWLPWD: (10) , (10)
OK
AT+DWLPWD= <oldpassword> , <newpassword> +CME ERROR: 3
or
OK
 
ParameterValues rangeDescriptionDefault value
oldpassword10Current download password (by default : "startdota")NA
newpassword10New password, to replace the old one (stored in non-volatile memory).NA

If the remote application enters the right password (three tries), the 1K XMODEM application over the air download is started, and the new application is installed on download end.


Updated : Thu Apr 27 14:12:36 CEST 2006